package org.wu.spring.db.integration.compare.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
@ConfigurationProperties(prefix = DbConfig.prefix)
public class DbConfig {
    public static final String prefix = "db";


    private String schemaName;
    private String tableName;


    private MysqlConfig mysqlConfig=new MysqlConfig();

    private ClickHouseConfig clickHouseConfig=new ClickHouseConfig();
    private ScyllaConfig scyllaConfig=new ScyllaConfig();
    private CassandraConfig cassandraConfig=new CassandraConfig();


    @Data
    public class MysqlConfig {
        private String url="jdbc:mysql://127.0.0.1:3306/spring_db_integration_compare?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useAffectedRows=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&databaseTerm=SCHEMA";

        private String username="root";
        private String password="wujiawei";
    }

    @Data
    public class ClickHouseConfig {
        private String url;

        private String username;
        private String password;
    }

    @Data
    public class ScyllaConfig {
        private String url;

        private String username;
        private String password;
    }

    @Data
    public class CassandraConfig {
        private String host;
        private int port;
        private String localDatacenter = "localDatacenter";

        private String username;
        private String password;
    }
}
